<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'manager_root.jsp' starting page</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/vendor/linearicons/style.css">
<!-- MAIN CSS -->
<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/main.css">
<!-- FOR DEMO PURPOSES ONLY. You should remove this in your project -->
<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/demo.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/dist/css/bootstrapValidator.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/datetimepicker/css/bootstrap-datetimepicker.min.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath }/assets/vendor/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/assets/dist/js/bootstrapValidator.js"></script>
<script src="${pageContext.request.contextPath }/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/assets/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/assets/datetimepicker/js/locales/bootstrap-datetimepicker.fr.js"></script>
</head>

<body>
	<c:set var="roottype" value="root"></c:set>
	<c:set var="editortype" value="editor"></c:set>
	<div id="wrapper">
		<jsp:include page="top.jsp"></jsp:include>
		<c:choose>
			<c:when test="${sessionScope.Manager.utype == pageScope.roottype}">
				<jsp:include page="leftroot.jsp"></jsp:include>
			</c:when>
			<c:when test="${sessionScope.Manager.utype == pageScope.editortype}">
				<jsp:include page="lefteditor.jsp"></jsp:include>
			</c:when>
		</c:choose>
		<div class="main">
			<div class="container">
				<div class="row">
					<!-- form: -->
					<section>
					<div class="page-header text-center">
						<h1>个人中心</h1>
					</div>

					<div class="col-lg-8 col-lg-offset-2">
						<form id="defaultForm" method="post" action="${pageContext.request.contextPath }/manage/UpdatePwdServlet.do"
							class="form-horizontal">
							<fieldset>
								<legend>修改密码</legend>
								<div class="form-group">
									<label class="col-lg-3 control-label">旧密码：</label>
									<div class="col-lg-5">
										<input type="password" class="form-control" name="oldpassword"
											 /><c:if test="${!empty result }">${result }</c:if>
									</div>
								</div>
								<div class="form-group">
									<label class="col-lg-3 control-label">新密码：</label>
									<div class="col-lg-5">
										<input type="password" class="form-control" name="password"
											 />
									</div>
								</div>

								<div class="form-group">
									<label class="col-lg-3 control-label">重复新密码：</label>
									<div class="col-lg-5">
										<input type="password" class="form-control"
											name="confirmPassword"  />
									</div>
								</div>
								
							</fieldset>						
								<div class="form-group">
									<div class="col-lg-2 col-lg-offset-4">
										<button type="submit" class="btn btn-primary btn-sm btn-block">修改</button>
									</div>
								</div>
						</form>
					</div>	
					</section>
					
					<!-- :form -->
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
			$('#defaultForm').bootstrapValidator({
				message : 'This value is not valid',
				feedbackIcons : {
					valid : 'glyphicon glyphicon-ok',
					invalid : 'glyphicon glyphicon-remove',
					validating : 'glyphicon glyphicon-refresh'
				},
				fields : {
					password : {
						validators : {
							notEmpty : {
								message : '不能为空'
							},
							identical : {
								field : 'confirmPassword',
								message : '两次密码输入不一致'
							}
						}
					},
					confirmPassword : {
						validators : {
							notEmpty : {
								message : '不能为空'
							},
							identical : {
								field : 'password',
								message : '两次密码输入不一致'
							}
						}
					},
				}
			});
		});
	</script>
</body>
</html>
